package com.xdxc.controller;

import com.xdxc.form.GradingResultForm;
import com.xdxc.mapper.TempUserAnswerMapper;
import com.xdxc.model.entity.TempUserAnswer;
import com.xdxc.model.vo.UserAnswerVo;
import com.xdxc.response.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.stream.Collectors;

@Slf4j
@RestController
@RequestMapping("/v1/getGradingResult/")
public class ExamResultController {


    @Autowired
    private TempUserAnswerMapper tempUserAnswerMapper;

    @PostMapping("/paper-result")
    public Result getPaperResult(@RequestBody GradingResultForm gradingResultForm){
       List<UserAnswerVo>  userAnswerWithGradingList=tempUserAnswerMapper.selectByPaperIdWithGrading(gradingResultForm.getPaperId());
        return Result.success(userAnswerWithGradingList) ;
    }

    @PostMapping("/grade")
    public Result getPaperResult(@RequestBody TempUserAnswer tempUserAnswer){
return null;
    }

}
